server {
        listen       80;
        server_name  localhost;
 
        location / {
            root       /home/poetry-vue2;
            index      index.html;
            try_files  $uri $uri/ /index.html;
        }
 
        location /im {
            alias      /home/poetry-vue3;
            index      index.html;
            try_files  $uri $uri/ /index.html;
        }
 
        location /api/ {
            rewrite           ^/api/(.*)$ /$1 break;
            proxy_pass        http://127.0.0.1:8081;
            proxy_redirect    off;
            proxy_set_header  Host $host;
            proxy_set_header  X-real-ip $remote_addr;
            proxy_set_header  X-Forwarded-For $proxy_add_x_forwarded_for;
        }
    }